package com.gupao.pattern.delegatestrategy.demo.strategy;

public class Order {

    private double cost;

    private String orderId;

    private String uid;

    private String payStrategy;

    public Order(double cost, String orderId, String uid, String payStrategy) {
        this.cost = cost;
        this.orderId = orderId;
        this.uid = uid;
        this.payStrategy = payStrategy;
    }

    void doPay() {
        Payment payStrategy = PayStrategy.getPayStrategy(this.payStrategy);
        payStrategy.doPay(cost);
    }
}
